<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%@ include file="/common/meta.jsp"%>
  </head>  
  <body>
      <table width="60%" border="1" cellpadding="0" align="center">
			<thead>
				<tr>
					<th style="cursor: hand;" title="按姓名进行排序" onclick="sortPage('name')" valign="top">
						姓名
					</th>
					<th style="cursor: hand;" title="按年龄进行排序" onclick="sortPage('age')" valign="top">
						年龄
					</th>
					<th style="cursor: hand;" title="按性别进行排序" onclick="sortPage('sex')" valign="top">
						性别
					</th>
					<th style="cursor: hand;" title="按地址进行排序" onclick="sortPage('address')" valign="top">
						地址
					</th>
					<th style="cursor: hand;" >
						操作
					</th>
				</tr>
			</thead>
			<tbody>			

				<c:forEach items="${userList}" var="user">
					<tr align="center">
						<td>
							${user.name}
						</td>
						<td>
							${user.age}
						</td>
						<td>
							${user.sex eq 1 ? "男" : user.sex eq 2 ? "女" : "未知"}
						</td>
						<td>
							${user.address}
						</td>
						<td>
							<a
								href="${pageContext.request.contextPath}/user/toAddUser.do">添加</a>
							|
							<a
								href="${pageContext.request.contextPath}/user/getUser/${user.id}.do">编辑</a>
							|
							<a
								href="${pageContext.request.contextPath}/user/delUser/${user.id}.do">删除</a>
						</td>
					</tr>
				</c:forEach>


			</tbody>
		</table>
		 <%@ include file="page.jsp"%>
		<br>
		<a href="${pageContext.request.contextPath}/index.jsp">返回</a>		
  </body>
</html>
